package cn.kgc.service.Impl;

import cn.kgc.mapper.PetMapper;
import cn.kgc.pojo.Pet;
import cn.kgc.service.PetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import cn.kgc.service.PetService;

import java.util.List;


@Service("petService")
public class PetServiceImpl implements PetService {

    @Autowired
    private PetMapper petMapper;

    @Override
    public List<Pet> findAllPetList() {
        return petMapper.getAllPetList();
    }

    @Override
    public Pet findPetByName(String name) {
        return petMapper.getPetByName(name);
    }

    @Override
    public Pet findPetById(int id) {
        return petMapper.getPetById(id);
    }

    @Override
    public int insert(Pet pet) {
        return petMapper.insertPet(pet);
    }

    @Override
    public int delete(int id) {
        return petMapper.deletePet(id);
    }

    @Override
    public List<Pet> findPetByNameOrNumber(String name, String num) {
        return petMapper.getPetByNameOrNumber(name, num);
    }
}
